namespace EFS.Common.Generators.Abstract.Characters
{
	public abstract class Pool : EFS.Common.Generators.Abstract.Interfaces.Characters.IPool
	{
		/// rand element 
		System.Random rand = null;

		/// constructor
		public Pool()
		{
			rand = new System.Random((int)System.DateTime.Now.Ticks);
		}

		/// Characters count in pool 
		public abstract System.Int32 Count
		{
			get;
		}

		/// Characters in pool 
		public abstract System.String All
		{
			get;
		}

		/// Get character at
		public System.Char At(System.Int32 index)
		{
			// check index
			EFS.Common.Verify.AbsoluteRange(index, -1, Count, "index");

			// verify All
			EFS.Common.Verify.Reference(All, "All");

			// get
			return All[index];
		}

		/// Get random character
		public System.Char Rand()
		{
			// verify All
			EFS.Common.Verify.Reference(All, "All");

			// get
			return All[rand.Next(Count)];
		}
	}
}
